package entity;

import com.example.a58.R;

import java.lang.reflect.Array;
import java.util.ArrayList;

public class GoodsInfo {
    public int id;
    public String name;
    public String description;
    public float price;
    public String picPath;
    public int pic;
    //声明一个手机商品的描述数组
    private static String[] mNameArray = {
            "iphone11","Mate30","小米10","oppo Reno3","vivo X30","荣耀30s"
    };
    //声明一个手机商品的描述数组

    private static String[] mDescArray = {
            "Apple iphone11 256GB ",
            "华为 HUAWEI Mate30 256GB",
            "小米 MI10 128G",
            "oppo Renoo3 128GB",
            "vivo X30 128GB",
            "荣耀30s 128GB"
    };
    private static final float[] mPriceArray = {6299,4999,3999,2999,2998,2399};
    private static int[] mPicArray = {
            R.mipmap.aa,R.mipmap.bb,R.mipmap.cc,R.mipmap.dd,R.mipmap.ic_launcher,R.mipmap.ic_launcher_round
    };
    public static ArrayList<GoodsInfo>  getDefaultList(){
        ArrayList<GoodsInfo> goodsList = new ArrayList<>();
        for (int i =0; i< mPriceArray.length; i++){
            GoodsInfo info = new GoodsInfo();
            info.id = i;
            info.pic = mPicArray[i];
            info.description = mDescArray[i];
            info.price = mPriceArray[i];
            info.name = mNameArray[i];

            goodsList.add(info);
        }
        return goodsList;
    }

    @Override
    public String toString() {
        return "GoodsInfo{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", price=" + price +
                ", picPath='" + picPath + '\'' +
                ", pic=" + pic +
                '}';
    }
}
